<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>内置线索</title>
    <script src="../commonjs/vue.js"></script>
</head>
<body>
    <div id="root">
        <school></school>
    </div>
    <script>
        Vue.config.productionTip = false;//关闭开发提示
        Vue.prototype.x = 99
        const school = Vue.extend({
            template:`
                <div>
                  <h2>{{name}}</h2>
                  <button @click="showX">点我显示x</button>
                </div>
            `,
            data(){
                return {
                    name:'Xccit'
                }
            },
            methods:{
                showX(){
                    console.log(this.x)  //VueComponent可以访问Vue实例的数据
                }
            }
        })
        const vm = new Vue({
            el:'#root',
            components:{school}
        })
    </script>
</body>
</html>